package com.springboot.example.monitor.dao.impl;

import com.springboot.example.monitor.dao.PolicyDao;
import com.springboot.example.monitor.mapper.PolicyMapper;
import com.springboot.example.monitor.domain.db.Policy;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;


/**
* Policy
*
* User: guoyao
* DateTime: 2016-02-23 16:23:51
*
*/
@Service("policyDao")
public class PolicyDaoImpl implements PolicyDao {

    @Resource
    private PolicyMapper policyMapper;

    /**
    *
    * 根据主键查询Policy对象
    *
    * @param policyId
    * @return Policy对象
    */
    @Override
    public Policy selectByPrimaryKey(Long policyId) {
        return policyMapper.selectByPrimaryKey(policyId);
    }

    /**
    *
    * 根据查询条件查询符合条件的Policy对象
    *
    * @param policy
    * @return 符合条件的Policy对象List
    */
    @Override
    public List<Policy> select(Policy policy) {
        return policyMapper.select(policy);
    }

    /**
    *
    * 根据主键删除Policy对象
    *
    * @param policyId
    * @return 影响条件数
    */
    @Override
    public int deleteByPrimaryKey(Long policyId) {
        return policyMapper.deleteByPrimaryKey(policyId);
    }

    /**
    *
    * 根据条件删除符合条件的Policy对象
    *
    * @param policy
    * @return 影响条件数
    */
    @Override
    public int delete(Policy policy) {
        return policyMapper.delete(policy);
    }

    /**
    *
    * 插入Policy对象
    *
    * @param policy
    * @return 影响条件数
    */
    @Override
    public int insert(Policy policy) {
        return policyMapper.insert(policy);
    }

    /**
    *
    * 更新Policy对象
    *
    * @param policy
    * @return 影响条件数
    */
    @Override
    public int update(Policy policy) {
        return policyMapper.update(policy);
    }
}
